package com.denlaku.longan.repository;

import com.denlaku.longan.anno.VarOp;
import com.denlaku.longan.dao.DashboardHisDao;
import com.denlaku.longan.qo.DashboardHisQuery;
import com.denlaku.longan.qo.Query;
import com.denlaku.longan.vo.DashboardHis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author tianx
 */
@Repository
public class DashboardHisRepository {
    @Autowired
    private DashboardHisDao dashboardHisDao;

    /**
     * 添加仪表板历史记录
     * @param dashboardHis 仪表板历史记录
     */
    @VarOp
    public void add(DashboardHis dashboardHis) {
        dashboardHisDao.add(dashboardHis);
    }

    /**
     * 删除仪表板历史记录
     * @param query 查询参数
     */
    public void delete(DashboardHisQuery query) {
        dashboardHisDao.delete(query);
    }

    /**
     * 获取仪表板历史记录
     * @param query 查询参数
     * @return 仪表板历史记录
     */
    public DashboardHis get(Query query) {
        return dashboardHisDao.get(query);
    }

    /**
     * 查询历史记录
     * @param query 查询参数
     * @return 仪表板历史记录
     */
    public List<DashboardHis> list(DashboardHisQuery query) {
        return dashboardHisDao.list(query);
    }
}
